package com.example.bookstore.service

import com.example.bookstore.dao.BookCategoryDao
import com.example.bookstore.entity.BookCategoryEntity
import com.example.bookstore.entity.BookEntity
import org.springframework.stereotype.Service

/**
 * Created by IntelliJ IDEA.
 * User: lvshe
 * Date: 2019/8/10
 * Time: 15:10
 */
@Service
class BookCategoryService : BaseService<BookCategoryDao, BookCategoryEntity>() {

     fun getBooksByIds(ids: String): List<BookEntity> {
        return super.getByIds(ids).flatMap { it.books }.distinct()
    }

}